package jp.co.sharp.android.decome.aobject;

import java.util.ArrayList;

public class Rotation1 extends AHandler {
	private float mTheta = 0;

	@Override
	public ArrayList<AObject> next(int mWidth, int mHeight) {
		ArrayList<AObject> list = new ArrayList<AObject>();

		for (int i = 0; i < 6; i++) {
			float theta = mTheta + i * 60;
			double radian = Math.PI * theta / 180;
			AObject object = null;
			object = new AObject();
			object.setXYZ((float) Math.sin(radian) * mHeight / 2,
					(float) Math.cos(radian) * mHeight / 2 / 10,
					(float) -Math.cos(radian));
			String bmp = null;
			switch (((int) mTheta / 5 + i) % 3) {
			case 0:
				bmp = "iVBORw0KGgoAAAANSUhEUgAAABQAAAAQCAYAAAAWGF8bAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAnVJREFUeNp8k71uE0EQx2fv1naaRIfdUrjgASw6RIGDhGginER8SDTYLRV5AsITgGhSRTmERIUUeAI7PUJGUSRQkDCCFnGAwL6vHf6ze3cykfHK4729nf3Nf2bnFBXjx+btvtL6Cvl+GzaBPVt7vj+iMyNavx5QkvY5jns8mxHF8REnadj6/GEi+8rCercOVK3Wp3qNMBNg2JEtFa7u7w2qoDdudihODgFqA0gEIE9hAs7zQevrx1DBqQtlQ1pZIdWoEwlQa1KeR8xMZEy4uvd08PNuP4CaTwAFPANsOrUgLqCUJBGA5zR5Xk8gqqaJ6nVSMFGK96QMgGna/3X/wWv68/seGxNACSk/I5YsxMRPgisVfDt/oSvADvmeU6ULaKOBtS9piCMpjg9Y64AAEkBlsqcsrKqxp2Sh3KZ1kqhQa6Gi3NUzKH2cPzn/s88CxMMRSa3wc7OtG3GWu1nWdnBhi0b1PkJYCuUgGaSHFFEz4jjBDU5hsVtnmU2fcgSwvi6oBOdSBPMYlzL21l6+mMhNcopDCQ4nyT/tYNtD3qcltAgswHI2VuGO/Gkr1JgdKOmyorZiqPC1VNdFFgBUoi3cbMGZg+YFlE3Y+nI6cjXEgMoIG1to2kh6jCVd6TNrM5u6VV5B0/lS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QBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAKBJREFUeNpcTjsKwkAQfRlmkzYgWlmk8AA5gHgGb+BR9GixE6s9gIWCnQp2IWGz68yywurAY968Nz9+LVcNgFYxu18OJGQr2An2YtYq1KlDo6VEmpTBtJgDZYmiqgDDYLNZCzHRLaYJ7B9PYBwR+h5BMrvTGUEceB9BYRgA52Ihf3R6pUMWlPHrV7A/gsy9k2DzEd1zywX733HUk0o+AgwAWMk1E/iqpwIAAAAASUVORK5CYII=";
				break;
			}
			object.setBmp(getBmp(bmp));
			list.add(object);
		}

		mTheta += 1;
		mTheta %= 360;

		return list;
	}

	@Override
	public int nextTime() {
		return 10;
	}
}
